<!--账户余额页面-->
<template>
	<view class="content-box">
		<view class="bal_main">
			<view class="title">账户余额(元)</view>
			<view class="num">{{sumBalance}}</view>
			<navigator url="/pages/user/inside/revenue" class="to">查看明细>></navigator>
			<button class="btn com_btn" hover-class="btn_click" @click="toWithd">提现</button>
		</view>
		<view class="bottom">
			<image class="img" mode="aspectFit" src="../../../../static/image/page/yepage.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sumBalance: ""
			};
		},
		onShow() {
			this.getBalance();
		},
		methods: {
			//获取余额
			getBalance() {
				this.$api.getBalance().then(res => {
					console.log(res)
					this.sumBalance = res.data.data.sumBalance
				})
			},
			//跳转提现
			toWithd() {
				uni.navigateTo({
					url: "/pages/user/inside/withdrawal"
				})
			}
		}
	}
</script>
<style>
	page {
		background: #F8F8F8;
	}
</style>
<style lang="scss">
	.content-box{
		padding: 28rpx 30rpx;
	}
	.bal_main {
		width: 100%;
		background: #FFFFFF;
		border-radius: 10rpx;
		height: 620rpx;
		padding: 110rpx 0;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;

		.btn {
			width: 80%;
			height: 80rpx;
			line-height: 80rpx;
		}

		.btn_click {
			opacity: 0.7;
		}

		.title {
			font-size: 36rpx;
			font-weight: 500;
			line-height: 70rpx;
			letter-spacing: 4px;
		}

		.num {
			font-size: 72rpx;
			font-weight: bold;
			color: #333333;
		}

		.to {
			font-size: 26rpx;
			color: #999999;
			line-height: 70rpx;
			;
		}
	}

	.bottom {
		margin-top: 20rpx;
		height: 140rpx;

		.img {
			width: 100%;
			height: 100%;
		}
	}
</style>
